package com.deng.mina.client;

import com.deng.mina.common.util.LogUtils;
import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IoSession;

/**
 * @Project
 * @Module
 * @JDK_Vserion 1.8
 * @Author DengLibin
 * @Email dlb@smarthse.cn
 * @Desc 客户端handler
 * @since 2019/9/17 0017 15:50
 */
public class ClientHandler extends IoHandlerAdapter {
    /**
     * 异常
     * @param session
     * @param cause
     * @throws Exception
     */
    @Override
    public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
        super.exceptionCaught(session, cause);
    }

    /**
     * 接收到数据
     * @param session
     * @param message
     * @throws Exception
     */
    @Override
    public void messageReceived(IoSession session, Object message) throws Exception {
        LogUtils.info("客户端接收到数据:" + message.toString());
    }
}
